<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <title>屏幕信息</title>
    </head>
    <body>
        <script>
            (function(){
                const b = document.body;
                let x = document.createElement('p');
                x.innerHTML = '可用宽度：' + screen.availWidth + ', 可用高度:' + screen.availHeight;
                b.appendChild( x );

                let y = document.createElement('p');
                y.innerHTML = '总宽度：' + screen.width + ', 总高度:' + screen.height;
                b.appendChild( y );

                let z = document.createElement('p');
                z.innerHTML = '色深：' + screen.colorDepth + ', 像素位数:' + screen.pixelDepth;
                b.appendChild( z );
            })();
        </script>
    </body>
</html>